Repository navigation
fix(@hertzg/ip): lead docs with the SSRF-guard use case - #298
Merged
Merged
Conversation
The prior docs opened with dual-stack normalization, but the reason developers reach for a library like this is checking whether an address is safe to fetch. Shipped SSRF guards in real codebases often only check loopback and link-local and miss private, CGNAT, or multicast ranges. classifyAddress returns one label from a closed set, so there's no list of booleans to keep in sync. Add that example first and move the CIDR-allowlist example up next to it.
Contributor
|
Docs preview: https://hertzg.github.io/jsr-monorepo/pr/298/ |
Contributor
Benchmark ResultsNo significant changes detected. 31 benchmark(s) within their noise floor. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #298 +/- ##
=======================================
Coverage 96.79% 96.79%
=======================================
Files 159 159
Lines 8494 8494
Branches 1301 1301
=======================================
Hits 8222 8222
Misses 152 152
Partials 120 120 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@hertzg/ip's docs led with dual-stack address normalization. A competitive
analysis of real production codebases (Countly, Postman, dbgate, Hugging
Face's chat-ui, and others) found the actual #1 reason developers reach for
a library like this is SSRF prevention: "is this address safe to fetch, or
does it point at my own network?" CIDR allowlist / trusted-proxy matching is
the #2 reason.
Shipped SSRF guards in these codebases are often subtly wrong — checking
only loopback and link-local, or relying on remembering a single "safe"
label out of many. This package's
classifyAddressreturns one label froma closed, total set, so there's no list of booleans to forget.
This is a docs-only change to the
@moduleJSDoc block inmod.ts(thispackage has no README — its JSR page is generated entirely from that
block):
the classification-based safety check.
up next to it.
Test plan
deno task lintpassesdeno task testpasses (new example runs as an executable JSDoc test)